package com.fowo.api.inventory.model.form;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fowo.api.inventory.model.InventoryStorageVo;
import com.fowo.api.inventory.model.TargetTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 仓库入库表单请求
 * @author yl_ls
 */
@Getter
@Setter
@Accessors(chain = true)
public class InventoryStorageFormVo extends InventoryStorageBaseVo {


    @Schema(title = "仓库内码")
    private Long stockId;

    @Schema(title = "to: 入库目标类型\n" +
            "    - Normal : 正常库存\n" +
            "    - Lock: 锁定库存\n" +
            "    - Display: 展示库存\n" +
            "    - Defect: 残次库存\n" +
            "    - Way: 在途库存")
    private TargetTypeEnum to;

    @Schema(title = "项目")
    private List<InventoryStorageVo> items;

    /**
     * 添加子项
     * @param storageVo 仓库操作子项
     */
    public InventoryStorageFormVo add(InventoryStorageVo storageVo) {
        if (items == null) {
            items = new ArrayList<>();
        }
        items.add(storageVo);
        return this;
    }

}
